package yiran.itemuse.output;

import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public class Logger {
    private static JavaPlugin plugin;
    private Logger() {}
    public static void init(JavaPlugin pluginInstance) {
        plugin = pluginInstance;
    }

    public static void info(String message) {
        plugin.getLogger().info(formatMessage(message, "§a"));
    }

    public static void warn(String message) {
        plugin.getLogger().warning(formatMessage(message, "§6"));
    }

    public static void error(String message) {
        plugin.getLogger().severe(formatMessage(message, "§c"));
    }

    public static void highlight(String message) {
        plugin.getLogger().info(formatMessage(message, "§e"));
    }

    private static String formatMessage(String message, String color) {
        return ChatColor.translateAlternateColorCodes('§',
            "§a§l[刀牌插件] " + color + "§l" + message);
    }

    public static void printBanner() {
        String[] banner = {
            "§b§l======== §e§l刀牌插件 §b§l========",
            "§b§l功能: §e物品指令绑定",
            "§b§l作者: §eYiran",
            "§b§l版本: §e1.0.0",
            "§b§l前置: §ePlayerPoints",
            "§b§l========================="
        };
        for (String line : banner) {
            plugin.getLogger().info(line);
        }
    }
}


